package com.derbysoft.synxisadapter.action.settings.user;

import com.derbysoft.synxisadapter.action.BaseAdapterAction;
import com.derbysoft.synxisadapter.commons.model.User;
import com.opensymphony.xwork2.Action;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;

import java.util.List;

@Results(value = {
    @Result(name = Action.SUCCESS, location = "/page/settings/user/List.ftl")
})
public class ListAction extends BaseAdapterAction {

    private List<User> users;

    public String execute() throws Exception {
        users = userRepository.listAll();
        return SUCCESS;
    }

    public List<User> getUsers() {
        return users;
    }
}
